package com.chinaunicom.product.domain.model.entity;

import com.chinaunicom.common.constants.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author guomenghuai
 * @date 2024/1/10
 * @Description
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProductSkuEntity {

    private Long productId;

    private String skuCode;

    private String productCode;

    /**
     * 商品类型 1:普通商品,2:预售商品
     */
    private Integer productType;

    private String productName;

    private String sellerId;

    private Integer currentPrice;

    private Integer originalPrice;

    private Integer stock;

    private String description;

    private String coverImg;

    private Integer status;

    public void checkProductStatus() {
        if (Objects.equals(Constants.DELETED, status)) {
            throw new RuntimeException("产品已被禁用");
        }
    }
}
